home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / cde.idb / usr / dt / share / include / Dt / TermPrim.h.z / TermPrim.h
Encoding:
C/C++ Source or Header  |  2003-11-18  |  12.5 KB  |  552 lines

  1. /*
  2.  * TermPrim.h
  3.  *
  4.  * Copyright 2000, Silicon Graphics, Inc.
  5.  * ALL RIGHTS RESERVED
  6.  * 
  7.  * UNPUBLISHED -- Rights reserved under the copyright laws of the United
  8.  * States.   Use of a copyright notice is precautionary only and does not
  9.  * imply publication or disclosure.
  10.  *
  11.  * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  12.  * Use, duplication or disclosure by the Government is subject to restrictions
  13.  * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  14.  * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  15.  * in similar or successor clauses in the FAR, or the DOD or NASA FAR
  16.  * Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  17.  * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  18.  *
  19.  * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  20.  * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  21.  * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  22.  * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  23.  * GRAPHICS, INC.
  24.  */
  25. /* $XConsortium: TermPrim.h /main/cde1_maint/1 1995/07/18 01:41:35 drk $ */
  26. /*
  27.  *  (c) Copyright 1993, 1994 Hewlett-Packard Company
  28.  *  (c) Copyright 1993, 1994 International Business Machines Corp.
  29.  *  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  30.  *  (c) Copyright 1993, 1994 Novell, Inc.
  31.  */
  32.  
  33. #ifndef    _Dt_TermPrim_h
  34. #define    _Dt_TermPrim_h
  35.  
  36. #include <sys/wait.h>
  37. #include <Xm/Xm.h>
  38.  
  39. #ifdef    __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43.  
  44. /*
  45.  * Constants
  46.  */
  47.  
  48. /* Resources */
  49.  
  50. #ifndef DtNbackgroundIsSelect
  51. #define    DtNbackgroundIsSelect    "backgroundIsSelect"
  52. #endif
  53. #ifndef DtNblinkRate
  54. #define DtNblinkRate        "blinkRate"
  55. #endif
  56. #ifndef DtNcharCursorStyle
  57. #define    DtNcharCursorStyle    "charCursorStyle"
  58. #endif
  59. #ifndef DtNconsoleMode
  60. #define    DtNconsoleMode        "consoleMode"
  61. #endif
  62. #ifndef DtNcsWidth
  63. #define    DtNcsWidth        "csWidth"
  64. #endif
  65. #ifndef DtNemulationId
  66. #define    DtNemulationId        "emulationId"
  67. #endif
  68. #ifndef    DtNinputVerifyCallback
  69. #define    DtNinputVerifyCallback    "inputVerifyCallback"
  70. #endif
  71. #ifndef DtNjumpScroll
  72. #define    DtNjumpScroll        "jumpScroll"
  73. #endif
  74. #ifndef DtNkshMode
  75. #define    DtNkshMode              "kshMode"       
  76. #endif
  77. #ifndef DtNlogFile
  78. #define    DtNlogFile              "logFile"    
  79. #endif
  80. #ifndef DtNlogInhibit
  81. #define    DtNlogInhibit        "logInhibit"
  82. #endif
  83. #ifndef DtNlogging
  84. #define    DtNlogging              "logging"    
  85. #endif
  86. #ifndef DtNloginShell
  87. #define    DtNloginShell        "loginShell"
  88. #endif
  89. #ifndef DtNmapOnOutput
  90. #define    DtNmapOnOutput           "mapOnOutput"
  91. #endif
  92. #ifndef DtNmapOnOutputDelay
  93. #define    DtNmapOnOutputDelay     "mapOnOutputDelay"
  94. #endif
  95. #ifndef DtNmarginBell
  96. #define    DtNmarginBell        "marginBell"
  97. #endif
  98. #ifndef DtNnMarginBell
  99. #define    DtNnMarginBell        "nMarginBell"
  100. #endif
  101. #ifndef    DtNoutputLogCallback
  102. #define    DtNoutputLogCallback    "outputLogCallback"
  103. #endif
  104. #ifndef DtNpointerBlank
  105. #define    DtNpointerBlank         "pointerBlank"
  106. #endif
  107. #ifndef DtNpointerBlankDelay
  108. #define    DtNpointerBlankDelay    "pointerBlankDelay"
  109. #endif
  110. #ifndef DtNpointerColor
  111. #define    DtNpointerColor         "pointerColor"
  112. #endif
  113. #ifndef DtNpointerColorBackground
  114. #define    DtNpointerColorBackground "pointerColorBackground"
  115. #endif
  116. #ifndef DtNpointerShape
  117. #define    DtNpointerShape         "pointerShape"
  118. #endif
  119. #ifndef DtNreverseVideo
  120. #define    DtNreverseVideo         "reverseVideo"
  121. #endif
  122. #ifndef DtNsaveLines
  123. #define    DtNsaveLines        "saveLines"
  124. #endif
  125. #ifndef DtNsizeList
  126. #define    DtNsizeList        "sizeList"
  127. #endif
  128. #ifndef DtNstatusChangeCallback
  129. #define    DtNstatusChangeCallback    "statusChangeCallback"
  130. #endif
  131. #ifndef DtNstickyNextCursor
  132. #define    DtNstickyNextCursor    "stickyNextCursor"
  133. #endif
  134. #ifndef DtNstickyPrevCursor
  135. #define    DtNstickyPrevCursor    "stickyPrevCursor"
  136. #endif
  137. #ifndef DtNsubprocessLoginShell
  138. #define    DtNsubprocessLoginShell    "subprocessLoginShell"
  139. #endif
  140. #ifndef DtNsubprocessPid
  141. #define    DtNsubprocessPid    "subprocessPid"
  142. #endif
  143. #ifndef DtNsubprocessExec
  144. #define    DtNsubprocessExec    "subprocessExec"
  145. #endif
  146. #ifndef DtNsubprocessTerminationCatch
  147. #define    DtNsubprocessTerminationCatch "subprocessTerminationCatch"
  148. #endif
  149. #ifndef DtNsubprocessCmd
  150. #define    DtNsubprocessCmd    "subprocessCmd"
  151. #endif
  152. #ifndef DtNsubprocessArgv
  153. #define    DtNsubprocessArgv    "subprocessArgv"
  154. #endif
  155. #ifndef DtNsubprocessTerminationCallback
  156. #define    DtNsubprocessTerminationCallback "subprocessTerminationCallback"
  157. #endif
  158. #ifndef DtNtermEmulationMode
  159. #define    DtNtermEmulationMode    "termEmulationMode"
  160. #endif
  161. #ifndef DtNtermDevice
  162. #define    DtNtermDevice        "termDevice"
  163. #endif
  164. #ifndef DtNtermDeviceAllocate
  165. #define    DtNtermDeviceAllocate    "termDeviceAllocate"
  166. #endif
  167. #ifndef DtNtermId
  168. #define    DtNtermId        "termId"
  169. #endif
  170. #ifndef DtNtermName
  171. #define    DtNtermName        "termName"
  172. #endif
  173. #ifndef DtNtermSlaveName
  174. #define    DtNtermSlaveName    "termSlaveName"
  175. #endif
  176. #ifndef DtNttyModes
  177. #define    DtNttyModes        "ttyModes"
  178. #endif
  179. #ifndef DtNuseFontSets
  180. #define    DtNuseFontSets        "useFontSets"
  181. #endif
  182. #ifndef DtNuseLineDraw
  183. #define    DtNuseLineDraw        "useLineDraw"
  184. #endif
  185. #ifndef DtNuserFont
  186. #define    DtNuserFont        "userFont"
  187. #endif
  188. #ifndef DtNuserBoldFont
  189. #define    DtNuserBoldFont        "userBoldFont"
  190. #endif
  191. #ifndef DtNvisualBell
  192. #define    DtNvisualBell        "visualBell"
  193. #endif
  194. #ifndef DtNallowSendEvents
  195. #define    DtNallowSendEvents      "allowSendEvents"
  196. #endif
  197. #ifndef DtNbaseHeight
  198. #define DtNbaseHeight        XmNbaseHeight
  199. #endif
  200. #ifndef DtNbaseWidth
  201. #define DtNbaseWidth        XmNbaseWidth
  202. #endif
  203. #ifndef DtNcolumns
  204. #define DtNcolumns        XmNcolumns
  205. #endif
  206. #ifndef DtNheightInc
  207. #define DtNheightInc        XmNheightInc
  208. #endif
  209. #ifndef DtNmarginHeight
  210. #define DtNmarginHeight        XmNmarginHeight
  211. #endif
  212. #ifndef DtNmarginWidth
  213. #define DtNmarginWidth        XmNmarginWidth
  214. #endif
  215. #ifndef DtNrows
  216. #define DtNrows            XmNrows
  217. #endif
  218. #ifndef DtNshadowType
  219. #define DtNshadowType        XmNshadowType
  220. #endif
  221. #ifndef DtNverticalScrollBar
  222. #define DtNverticalScrollBar    XmNverticalScrollBar
  223. #endif
  224. #ifndef DtNwidthInc
  225. #define DtNwidthInc        XmNwidthInc
  226. #endif
  227. /* _TP_ALL_{ NEW_WINDOW_RES */
  228. #ifndef DtNallowNewWindow
  229. #define    DtNallowNewWindow    "allowNewWindow"
  230. #endif
  231. /* _TP_ALL_} */
  232.  
  233. #ifndef DtCBackground
  234. #define    DtCBackground        XmCBackground
  235. #endif
  236. #ifndef DtCBackgroundIsSelect
  237. #define    DtCBackgroundIsSelect    "BackgroundIsSelect"
  238. #endif
  239. #ifndef DtCBlinkRate
  240. #define DtCBlinkRate        "BlinkRate"
  241. #endif
  242. #ifndef DtCCallback
  243. #define DtCCallback        XmCCallback
  244. #endif
  245. #ifndef DtCCursor
  246. #define    DtCCursor        XmCCursor
  247. #endif
  248. #ifndef DtCConsoleMode
  249. #define    DtCConsoleMode        "ConsoleMode"
  250. #endif
  251. #ifndef DtCCsWidth
  252. #define    DtCCsWidth        "CsWidth"
  253. #endif
  254. #ifndef DtCCharCursorStyle
  255. #define    DtCCharCursorStyle    "CharCursorStyle"
  256. #endif
  257. #ifndef DtCEmulationId
  258. #define    DtCEmulationId        "EmulationId"
  259. #endif
  260. #ifndef DtCForeground
  261. #define    DtCForeground        XmCForeground
  262. #endif
  263. #ifndef DtCJumpScroll
  264. #define    DtCJumpScroll        "JumpScroll"
  265. #endif
  266. #ifndef DtCKshMode
  267. #define    DtCKshMode              "KshMode"       
  268. #endif
  269. #ifndef DtCLogFile
  270. #define    DtCLogFile              "LogFile"    
  271. #endif
  272. #ifndef DtCLogInhibit
  273. #define    DtCLogInhibit        "LogInhibit"
  274. #endif
  275. #ifndef DtCLogging
  276. #define    DtCLogging              "Logging"    
  277. #endif
  278. #ifndef DtCLoginShell
  279. #define    DtCLoginShell        "LoginShell"
  280. #endif
  281. #ifndef DtCMapOnOutput
  282. #define    DtCMapOnOutput           "MapOnOutput"
  283. #endif
  284. #ifndef DtCMapOnOutputDelay
  285. #define    DtCMapOnOutputDelay     "MapOnOutputDelay"
  286. #endif
  287. #ifndef DtCMarginBell
  288. #define    DtCMarginBell        "MarginBell"
  289. #endif
  290. #ifndef DtCNMarginBell
  291. #define    DtCNMarginBell        "NMarginBell"
  292. #endif
  293. #ifndef DtCPointerBlank
  294. #define    DtCPointerBlank         "PointerBlank"
  295. #endif
  296. #ifndef DtCPointerBlankDelay
  297. #define    DtCPointerBlankDelay    "PointerBlankDelay"
  298. #endif
  299. #ifndef DtCPointerColor
  300. #define    DtCPointerColor         "PointerColor"
  301. #endif
  302. #ifndef DtCPointerColorBackground
  303. #define    DtCPointerColorBackground "PointerColorBackground"
  304. #endif
  305. #ifndef DtCPointerShape
  306. #define    DtCPointerShape         "PointerShape"
  307. #endif
  308. #ifndef DtCReverseVideo
  309. #define    DtCReverseVideo        "ReverseVideo"
  310. #endif
  311. #ifndef DtCSaveLines
  312. #define    DtCSaveLines        "SaveLines"
  313. #endif
  314. #ifndef DtCSizeList
  315. #define    DtCSizeList        "SizeList"
  316. #endif
  317. #ifndef DtCStickyCursor
  318. #define    DtCStickyCursor        "StickyCursor"
  319. #endif
  320. #ifndef DtCSubprocessLoginShell
  321. #define    DtCSubprocessLoginShell    "SubprocessLoginShell"
  322. #endif
  323. #ifndef DtCSubprocessPid
  324. #define    DtCSubprocessPid    "SubprocessPid"
  325. #endif
  326. #ifndef DtCSubprocessExec
  327. #define    DtCSubprocessExec    "SubprocessExec"
  328. #endif
  329. #ifndef DtCSubprocessTerminationCatch
  330. #define    DtCSubprocessTerminationCatch "SubprocessTerminationCatch"
  331. #endif
  332. #ifndef DtCSubprocessCmd
  333. #define    DtCSubprocessCmd    "SubprocessCmd"
  334. #endif
  335. #ifndef DtCSubprocessArgv
  336. #define    DtCSubprocessArgv    "SubprocessArgv"
  337. #endif
  338. #ifndef DtCTermEmulationMode
  339. #define    DtCTermEmulationMode    "TermEmulationMode"
  340. #endif
  341. #ifndef DtCTermDevice
  342. #define    DtCTermDevice        "TermDevice"
  343. #endif
  344. #ifndef DtCTermDeviceAllocate
  345. #define    DtCTermDeviceAllocate    "TermDeviceAllocate"
  346. #endif
  347. #ifndef DtCTermId
  348. #define    DtCTermId        "TermId"
  349. #endif
  350. #ifndef DtCTermName
  351. #define    DtCTermName        "TermName"
  352. #endif
  353. #ifndef DtCTermSlaveName
  354. #define    DtCTermSlaveName    "TermSlaveName"
  355. #endif
  356. #ifndef DtCTtyModes
  357. #define    DtCTtyModes        "TtyModes"
  358. #endif
  359. #ifndef DtCUseFontSets
  360. #define    DtCUseFontSets        "UseFontSets"
  361. #endif
  362. #ifndef DtCUseLineDraw
  363. #define    DtCUseLineDraw        "UseLineDraw"
  364. #endif
  365. #ifndef DtCUserFont
  366. #define    DtCUserFont        "UserFont"
  367. #endif
  368. #ifndef DtCUserBoldFont
  369. #define    DtCUserBoldFont        "UserBoldFont"
  370. #endif
  371. #ifndef DtCVisualBell
  372. #define    DtCVisualBell        "VisualBell"
  373. #endif
  374. #ifndef DtCAllowSendEvents
  375. #define    DtCAllowSendEvents      "AllowSendEvents"
  376. #endif
  377. #ifndef DtCBaseHeight
  378. #define DtCBaseHeight        XmCBaseHeight
  379. #endif
  380. #ifndef DtCBaseWidth
  381. #define DtCBaseWidth        XmCBaseWidth
  382. #endif
  383. #ifndef DtCColumns
  384. #define DtCColumns        XmCColumns
  385. #endif
  386. #ifndef DtCHeightInc
  387. #define DtCHeightInc        XmCHeightInc
  388. #endif
  389. #ifndef DtCMarginHeight
  390. #define DtCMarginHeight        XmCMarginHeight
  391. #endif
  392. #ifndef DtCMarginWidth
  393. #define DtCMarginWidth        XmCMarginWidth
  394. #endif
  395. #ifndef DtCRows
  396. #define DtCRows            XmCRows
  397. #endif
  398. #ifndef DtCShadowType
  399. #define DtCShadowType        XmCShadowType
  400. #endif
  401. #ifndef DtCVerticalScrollBar
  402. #define DtCVerticalScrollBar    XmCVerticalScrollBar
  403. #endif
  404. #ifndef DtCWidthInc
  405. #define DtCWidthInc        XmCWidthInc
  406. #endif
  407.  
  408. /* _TP_ALL_{ NEW_WINDOW_RES */
  409. #ifndef DtCAllowNewWindow
  410. #define    DtCAllowNewWindow    "AllowNewWindow"
  411. #endif
  412. /* _TP_ALL_} */
  413.  
  414. /* Representation types */
  415.  
  416. #define DtRDtTermCharCursorStyle    "DtTermCharCursorStyle"
  417. #define DtRDtTermEmulationMode        "DtTermEmulationMode"
  418. #define    DtRDtTermTerminalSize        "DtTermTerminalSize"
  419. #define    DtRDtTermTerminalSizeList    "DtTermTerminalSizeList"
  420.  
  421. /* DtNshadowType values */
  422.  
  423. #ifndef DtSHADOW_IN
  424. #define DtSHADOW_IN        XmSHADOW_IN
  425. #endif
  426. #ifndef DtSHADOW_OUT
  427. #define DtSHADOW_OUT        XmSHADOW_OUT
  428. #endif
  429. #ifndef DtSHADOW_ETCHED_IN
  430. #define DtSHADOW_ETCHED_IN    XmSHADOW_ETCHED_IN
  431. #endif
  432. #ifndef DtSHADOW_ETCHED_OUT
  433. #define DtSHADOW_ETCHED_OUT    XmSHADOW_ETCHED_OUT
  434. #endif
  435.  
  436. #define    DtTERM_CHAR_CURSOR_BOX        0
  437. #define    DtTERM_CHAR_CURSOR_BAR        1
  438. #define    DtTERM_CHAR_CURSOR_INVISIBLE    2
  439.  
  440. #define    DtTermEMULATIONHP    0
  441. #define    DtTermEMULATIONANSI    1
  442.  
  443. /* Callback reasons */
  444.  
  445. #define    DtCR_TERM_SUBPROCESS_TERMINATION    1
  446. #define DtCR_TERM_STATUS_CHANGE        2
  447. #define    DtCR_TERM_INPUT_VERIFY        7
  448. #define    DtCR_TERM_OUTPUT_LOG        8
  449.  
  450.  
  451. /*
  452.  * Types
  453.  */
  454.  
  455. /* insert char mode */
  456.  
  457. typedef enum {
  458.     DtTERM_INSERT_CHAR_OFF = 0,
  459.     DtTERM_INSERT_CHAR_ON,
  460.     DtTERM_INSERT_CHAR_ON_WRAP
  461. } DtTermInsertCharMode;
  462.  
  463. typedef struct {
  464.     int        reason;
  465.     XEvent        *event;
  466.     int        cursorX;
  467.     int        cursorY;
  468.     Boolean        capsLock;
  469.     Boolean        stop;
  470.     DtTermInsertCharMode insertCharMode;
  471.     Boolean        locked;
  472. } DtTermStatusChangeCallbackStruct;
  473.  
  474. typedef struct {
  475.     int        reason;
  476.     XEvent        *event;
  477.     pid_t        pid;
  478.     int        status;
  479. } DtTermSubprocessTerminationCallbackStruct;
  480.  
  481. typedef struct {
  482.     int        reason;
  483.     XEvent        *event;
  484.     Boolean        doit;
  485.     unsigned char    *text;
  486.     int        length;
  487. } DtTermInputVerifyCallbackStruct;
  488.  
  489. typedef struct {
  490.     int        reason;
  491.     XEvent        *event;
  492.     unsigned char    *text;
  493.     int        length;
  494. } DtTermOutputLogCallbackStruct;
  495.  
  496. typedef struct _DtTermTerminalSize {
  497.     short        rows;
  498.     short        columns;
  499. } DtTermTerminalSize;
  500.  
  501. typedef struct _DtTermTerminalSizeList {
  502.     int        numSizes;
  503.     DtTermTerminalSize *sizes;
  504. } DtTermTerminalSizeList;
  505.  
  506. /* Widget class and instance */
  507.  
  508. typedef struct _DtTermPrimitiveClassRec *DtTermPrimitiveWidgetClass;
  509. typedef struct _DtTermPrimitiveRec      *DtTermPrimitiveWidget;
  510.  
  511.  
  512. /*
  513.  * Data
  514.  */
  515.  
  516. /* Widget class record */
  517.  
  518. externalref WidgetClass dtTermPrimitiveWidgetClass;
  519.  
  520.  
  521. /*
  522.  * Functions
  523.  */
  524.  
  525. extern Widget DtCreateTermPrimitive(
  526.         Widget        parent,
  527.         char        *name,
  528.         ArgList        arglist,
  529.         Cardinal    argcount);
  530.  
  531. extern void DtTermInitialize(void);
  532.  
  533. extern void DtTermDisplaySend(
  534.         Widget        widget,
  535.         unsigned char    *buffer,
  536.         int        length);
  537.  
  538. extern void DtTermSubprocSend(
  539.         Widget        widget,
  540.         unsigned char    *buffer,
  541.         int        length);
  542.  
  543. extern void DtTermSubprocReap(
  544.         pid_t        pid,
  545.         int        *stat_loc);
  546.  
  547. #ifdef    __cplusplus
  548. }
  549. #endif
  550.  
  551. #endif    /* _Dt_TermPrim_h */
  552.